public class Triangle extends Graph{
    private double first;
    private double second;
    private double third;
    public Triangle(){}
    public Triangle(double first,double second,double third){
        this.first = first;
        this.second = second;
        this.third = third;
    }
    public void setFirst(double first){
        this.first = first;
    }
    public double getFirst(){
        return first;
    }
    public void setSecond(double second){
        this.second = second;
    }
    public double getSecond(){
        return second;
    }
    public void setThird(double third){
        this.third = third;
    }
    public double getThird(){
        return third;
    }

    @Override
    public double perimeter() {

        return getFirst()+getSecond()+getThird();
    }

    @Override
    public double area() {

      return  Math.sqrt(((getFirst()+getSecond()+getThird())/2)
                * (((getFirst()+getSecond()+getThird())/2)-getFirst())*
                (((getFirst()+getSecond()+getThird())/2)-getSecond())
                *(((getFirst()+getSecond()+getThird())/2)-getThird()));


    }
}
